#pragma once

PLATFORM_API DWORD XY_GetTickCount();

#ifdef _MSC_VER
#define RDTSC   __rdtsc
#endif

#ifdef __linux
inline uint64_t RDTSC()
{
    uint64_t uCPUTick       = 0;
    uint32_t uCPUTickLow    = 0;
    uint32_t uCPUTickHigh   = 0;

    __asm__ __volatile__("rdtsc" : "=a" (uCPUTickLow), "=d" (uCPUTickHigh): );

    uCPUTick = (((uint64_t)uCPUTickHigh) << 32) + uCPUTickLow;
    return uCPUTick;
}
#endif
